import Vue from 'vue'
import axios from 'axios'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';

Vue.use(ElementUI);

import DateTool from './date';
Vue.prototype.$DateTool = DateTool;

import { Message,MessageBox } from 'element-ui';
Vue.prototype.$Message = Message;
Vue.prototype.$MessageBox = MessageBox;


import damiTextInput from 'dami-text-input'
Vue.component('dami-text-input', damiTextInput);
import damiSingleLineTable from 'dami-single-line-table'
Vue.component('dami-single-line-table', damiSingleLineTable);
import damiTableSelectPanel from 'dami-table-select-panel'
Vue.component('dami-table-select-panel', damiTableSelectPanel);
import damiDialog from '../../component/dami-dialog'
Vue.component('dami-dialog', damiDialog);


import navigation from '../../component/navigation'
import loadsection from '../../component/loadSection'
import datepicker from '../../component/datepicker'
import spin from '../../component/spin'
import page from '../../component/page'

Vue.component('dami-datepicker', datepicker);
Vue.component('Spin', spin);
Vue.component('Page', page);
//用户组件之间通信
const commonVue = new Vue();



//退出登录
let userExit = function(){
  window.location.href = window.location.origin+"/logout";
}

const methods = {
  userExit:userExit
}



export  {
    Vue,
    axios,
    commonVue,
    navigation,
    loadsection,
    methods
};
